<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			#box{
				width: 200px;
				height: 200px;
				background-color: red;
				border: 1px solid #000;
			}
		</style>
	</head>
	<body>
		<div id="box" style="width: 200px;"></div>
		<script type="text/javascript">
			window.onload = function() {
				var box = document.getElementById('box');
				move(box);
				function move(obj) {
					setInterval(function(){
						obj.style.width = parseInt(getStyle(box,'width')) - 1 + 'px';
					},30);
				}
				function getStyle(obj,attr) {
					return getComputedStyle(obj,null)[attr];
				}
			}
		</script>
	</body>
	
</html>